//
//  AppDelegate.m
//  MyFamework
//
//  Created by carlos on 12-10-1.
//  Copyright (c) 2012年 carlos. All rights reserved.
//

#import "AppDelegate.h"
#import "TestViewController.h"
#import "HttpService.h"
#import "UMengHandler.h"
@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [HttpService instance];
    [UMengHandler registerNotify];
//    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//    self.window.backgroundColor = [UIColor whiteColor];
//    TestViewController *testViewController = [[TestViewController alloc]init];
//    
//    UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:testViewController];
//    nav.navigationBarHidden = !kCgHasNav;
//    
//    self.window.rootViewController = nav;
//    [self.window makeKeyAndVisible];
    //发送广播
    NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
    if (application) {
        [userInfo setValue:application forKey:kWKey1];
    }
    if (launchOptions) {
        [userInfo setValue:launchOptions forKey:kWKey2];
    }
    [[NSNotificationCenter defaultCenter] postNotificationName:kAppDelegateDidFinishLaunchingWithOptions object:nil userInfo:userInfo];
    return YES;
}

//当应用程序入活动状态执行
- (void)applicationDidBecomeActive:(UIApplication *)application
{
    //发送广播
    NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
    if (application) {
        [userInfo setValue:application forKey:kWKey1];
    }

    [[NSNotificationCenter defaultCenter] postNotificationName:kApplicationDidBecomeActive object:nil userInfo:userInfo];
}
@end
